package com.internship.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.internship.dao.PaperDao;
import com.internship.model.Paper;
import com.internship.page.Page;

@Service
public class PaperService {
	private final int PAGE_SIZE = 10;
	@Autowired
	private PaperDao paperDao;

	public Paper getPaperById(int Id) {
		return paperDao.getPaperById(Id);
	}
	public Page<Paper> getPlanList(String DeptCode,String Title,int pageNumber) {
		Page<Paper> page = new Page<Paper>(pageNumber, PAGE_SIZE);
		List<Paper> list = paperDao.getPaperList(DeptCode, Title, page);
		page.setResultList(list);
		return page;
	}
	public int addPaper(Paper paper) {
		return paperDao.addPaper(paper);
	}
	public int updatePlan(Paper paper) {
		return paperDao.updatePaper(paper);
	}
	public int delPaper(int Id) {
		return paperDao.delPaper(Id);
	}
	public int updateDownloadCount(int Id) {
		return paperDao.updateDownloadCount(Id);
	}
	public int delAll(String[] ids) {
		return paperDao.delAll(ids);
	}

}
